<script>
import YmDialogButton from './YmDialogButton'

/**
 * props: {
 *    row: object, 请求参数
 *    ...action
 * }
 */
export default {
  name: 'YmUrlDialogButton',
  functional: true,
  render (h, context) {
    const { props, data, parent } = context
    const setContent = async () => {
      return parent.$http.Fire(props, props.row)
    }
    return h(YmDialogButton, {
      ...data,
      props: {
        ...(data.props || {}),
        ...props,
        setContent
      }
    })
  }
}
</script>
